package com.ruoyi.eqmonitor.service;

import java.text.ParseException;
import java.util.*;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.eqmonitor.domain.OptDeviceMonitorLastData;
import com.ruoyi.eqmonitor.dtos.*;
import com.ruoyi.eqmonitor.exception.OpentsdbException;
import com.ruoyi.eqmonitor.vo.CockpitVo;
import com.ruoyi.eqmonitor.vo.OptDeviceMonitorLastDataVo;
import org.opentsdb.client.bean.request.SubQuery;

/**
 * @author ruoyi
 * @date 2022-11-25
 */
public interface IOptDeviceMonitorLastDataService extends IService<OptDeviceMonitorLastData>{

    public OptDeviceMonitorLastData selectOptDeviceMonitorLastDataById(Long id);

    public List<OptDeviceMonitorLastData> selectOptDeviceMonitorLastDataList(OptDeviceMonitorLastData optDeviceMonitorLastData);

    /**
     * 批量新增或更新监测数据
     * @param listData 列表数据
     * @return 是否批量执行成功
     */
    public void saveOrUpdateMonitorLastData(Collection<OptDeviceMonitorLastData> listData);

    List<Map<String, Object>> selectFlow() throws OpentsdbException, ParseException;

    List<Map<String, Object>> selectGuandao() throws ParseException, OpentsdbException;

    List<Map<String, Object>> selectAnDanLiuLiangNYR(String datetime , Integer state) throws ParseException, IllegalAccessException, OpentsdbException;

    List<Map<String,Object>> selectAnDanShuiZhi(String deviceName,Integer state) throws ParseException, OpentsdbException;

    List<Map<String, Object>> selectRiverwayMonitor(RiverwayMonitorDto dto) throws ParseException, IllegalAccessException, OpentsdbException;

    List<RiverwayMonitorExport> selectRiverwayMonitorExport(RiverwayMonitorDto dto) throws ParseException, OpentsdbException;

    List<Map<String, Object>> selectWaterCondition(WaterQualityReportDto dto, SubQuery.Filter monitorCodeFilter) throws ParseException, OpentsdbException;

    List<WaterConditionExport> selectWaterConditionExport(WaterQualityReportDto dto, SubQuery.Filter monitorCodeFilter) throws ParseException, OpentsdbException;

    List<Map<String, Object>> selectWaterConditionAnalyse(WaterConditionAnalyseDto dto) throws ParseException, OpentsdbException;

    boolean selectRainfall(RiverwayMonitorDto dto) throws ParseException, OpentsdbException;

    List<Map<String, Object>> selectMonthCOD(String deviceCode) throws ParseException, OpentsdbException;

    List<Map<String, Object>> selectWellLid(String siteId) throws ParseException, OpentsdbException;

    //氨氮一体机 流量-河道报警
    List<CockpitVo> riverwayFlow(CockpitRiverwayAlarmDto dto1) throws ParseException, OpentsdbException;

    //一杠式 液位-河道报警
    List<CockpitVo> riverwayLiquidLevel(CockpitRiverwayAlarmDto dto) throws ParseException, OpentsdbException;

    OptDeviceMonitorLastData getBySncodeAndCode(String finalCode, String snCode);

    List<OptDeviceMonitorLastDataVo> selectOptDeviceMonitorLastDataPage(OptDeviceMonitorLastDataVo optDeviceMonitorLastData);
}
